<%@page import="co.gov.medellin.ssti.sub.model.dao.exception.DAOException"%>
<%@page import="java.util.Collection"%>
<%@page import="co.gov.medellin.ssti.sub.service.ConsultasService"%>
<%@ page contentType="text/html;charset=utf-8"%>
<%@page
	import="co.gov.medellin.ssti.sub.common.ConnectionFactory,co.gov.medellin.ssti.sub.common.dao.Consultas,java.sql.Connection,java.sql.ResultSet,java.sql.SQLException"%>
<%@page import="co.gov.medellin.ssti.sub.model.vo.ProgramaVO" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<%=request.getContextPath() + "/css/bloques.css"%>"
	rel="stylesheet" type="text/css">
<title>Detalle Programa</title>
</head>
<body>

	<P></P>
	<P></P>
	<P></P>
	<P align="center"></P>
	<P align="center" class="titulosenblanco">ADMINISTRACION DE
		PROGRAMAS</P>
	<P align="center"></P>
	<form name="form" method="get"
		action="../../servlets/programas/ingresarprograma">
		<div align="center">
			<table
				style="width: 30%; border: 0; padding: 3px; border-spacing: 2px;">
				<%
					String strcodigo = request.getParameter("Codigo");
					String strnombre = "";
					String strobjetivo = "";
					String strdescripcion = "";
					String strarea = "";
					String strusuario = "";
					String strpoblacion = "";
					String strvigencia = "";
					String strdesde = "";
					String strhasta = "";

					ConsultasService consulta = new ConsultasService();
					Collection<ProgramaVO> rs = null;

					try {
						rs = consulta.getDetPrograma(strcodigo);
					} catch (Exception e) {
					}

					if (rs != null) {
						try {
							for (ProgramaVO vo : rs) {
								strnombre = vo.getNombre();
								strobjetivo = vo.getObjetivo();
								strdescripcion = vo.getDescripcion();
								strarea = vo.getNombreArea();
								strusuario = vo.getNombreUsuario();
								strpoblacion = vo.getPoblacionObjetivo();
								strdesde = vo.getDesdeVigencia();
								strhasta = vo.getHastaVigencia();
								strvigencia = vo.getVigencia();
							}
						} catch (DAOException e) {
							e.printStackTrace();
						}
					} else {
				%>
				<tr>
					<td colspan="2"><font>Ocurrio un error, al realizar la
							consulta</font></td>
				</tr>
				<%
					}
				%>
				<tr>
					<td class="celdatabla" width="19%">Nombre</td>
					<td width="81%"><input type="text" Class="form"
						value="<%=strnombre%>" maxlength="40" size="40" name="programa"
						readonly /></td>
				</tr>
				<tr>
					<td class="celdatabla" width="19%">Objetivo</td>
					<td width="81%"><textarea name="objetivo" Class="form"
							cols="30" rows="5" disabled="disabled"><%=strobjetivo%></textarea>
					</td>
				</tr>
				<tr>
					<td class="celdatabla" width="19%">Descripcion</td>
					<td width="81%"><textarea name="descripcion" Class="form"
							cols="30" rows="5" disabled="disabled"><%=strdescripcion%></textarea>
					</td>
				</tr>
				<tr>
					<td class="celdatabla" width="19%">Secretaria</td>
					<td width="81%"><input type="text" Class="form"
						value="<%=strarea%>" name="area" maxlength="40" size="40" readonly />
					</td>
				</tr>
				<tr>
					<td class="celdatabla" width="19%">Administrador</td>
					<td width="81%"><input type="text" Class="form"
						value="<%=strusuario%>" name="usuario" maxlength="40" size="40"
						readonly /></td>
				</tr>
				<tr>
					<td class="celdatabla" width="19%">Poblacion</td>
					<td width="81%"><input type="text" Class="form"
						value="<%=strpoblacion%>" name="poblacion" maxlength="40"
						size="40" readonly /></td>
				</tr>
				<tr>
					<td class="celdatabla" width="19%">Desde(*)</td>
					<td width="81%"><input type="text" Class="form"
						value="<%=strdesde%>" name="desde" maxlength="15" size="15"
						readonly /></td>
				</tr>
				<tr>
					<td class="celdatabla" width="19%">Hasta(*)</td>
					<td width="81%"><input type="text" Class="form"
						value="<%=strhasta%>" name="hasta" maxlength="15" size="15"
						readonly /></td>
				</tr>
				<tr>
					<td class="celdatabla" width="19%">Vigencia</td>
					<td width="81%"><input type="text" Class="form"
						value="<%=strvigencia%>" name="vigencia" maxlength="10" size="10"
						readonly /></td>
				</tr>
				<tr>
					<td width="19%">&nbsp;</td>
					<td width="81%"></td>
				</tr>
				<tr>
					<td width="19%">&nbsp;</td>

					<td width="81%">
						<DIV align="center">
							<input type="hidden" name="ori" value="mod" /> <input
								type="hidden" name="Programa" value="<%=strnombre%>" /> <a
								href="javascript:window.history.back()"> <img
								src="<%=request.getContextPath() + "/images/BACK1-1.gif"%>"
								border="0" />
							</a>&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						</DIV>
					</td>
				</tr>
			</table>
		</div>
		<P>&nbsp;</P>
		<P>&nbsp;</P>
	</form>
</body>
</html>
